<?php


class GridController extends FW24H_AppController{
	var $useHelpers = array( 'HtmlHelper','UrlHelper', 'GridHelper');

	function index() {
		$this->loadModel( 'User');
		$users = $this->User->find();
		$this->setParam( 'users', $users);
		//pre( $users);
		$this->loadHelper( 'FormHelper');
		$this->loadHelper( 'URLHelper');
		$this->loadHelper( 'FW24hGridHelper');
		
		$user = $this->User->get( 1);
		pre( $user);
		

		/*----------------*/
		$aForm['abc'] = array( 'validate'=>'function:fw24h_isEmail', 'error'=>'Loi');
		$aFormError = fw24h_form_validate( $aForm);
		foreach( $user as $a=>$b) {
			if( is_numeric( $a)) continue; 
			echo $a;
			$aFormError[$a]['value'] = $b;
		}
		pre( $aFormError);
		
		$this->setParam( 'form', $aFormError);
		/*----------------*/
		
		$this->render();
	}

}



